# -*- coding: utf-8 -*-
import unittest
from templatetags.formatfilters import *
from text.typo.tests import *

class WikiTestCase(unittest.TestCase):
#    def test_list(self):
#        self.assertEquals(wikiblock(
#            u"""  * item1\n""" +
#             """  * item2\n""" +
#             """  * item3\n"""
#            ),
#            u"""<ul><li>item1</li><li>item2</li><li>item3</li></ul>"""
#        )
    def test_p(self):
        self.assertEquals(wikiblock(
            u"""123"""),
            u"""<p>123</p>"""
        )

    def test_heading(self):
        self.assertEquals(wikiblock(
            u"""
            ==11==
            ===22===
            ====33====
            """),
            u"""<h1>11</h1><h2>22</h2><h3>33</h3>"""
        )

    def test_bold(self):
        self.assertEquals(wikiinline(
            u"""**мясо**"""),
            u"""<b>мясо</b>"""
        )
        self.assertEquals(wikiinline(
            u""" **омг b c** """),
            u"""<b>омг b c</b>"""
        )

    def test_italic(self):
        self.assertEquals(wikiinline(
            u"""//рыба//"""),
            u"""<i>рыба</i>"""
        )
        self.assertEquals(wikiinline(
            u""" //ЭТО да// """),
            u"""<i>ЭТО да</i>"""
        )

    def test_link(self):
        self.assertEquals(wikiinline(
            u"""((http://ya.ru яндыкс))"""),
            u"""<a href="http://ya.ru">яндыкс</a>"""
        )
        self.assertEquals(wikiinline(
            u"""[[http://ya.ru яндыкс]]"""),
            u"""<a href="http://ya.ru">яндыкс</a>"""
        )


if __name__ == "__main__":
    unittest.main()
